import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
// 全局分享
// 小程序分享的封装
import share from "./utils/share.js"
Vue.mixin(share)
const app = new Vue({
  ...App
})

app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
import { usePermissionDirective } from './utils/directives.js'
// main.js，注意要在use方法之后执行
import uviewPlus from './uni_modules/uview-plus/index.js'

export function createApp() {
  const app = createSSRApp(App)
  app.use(Pinia.createPinia())
  app.use(uviewPlus)
  // 如此配置即可
  // uni.$u.config.unit = 'rpx'
  usePermissionDirective(app)
  return {
    app,
	Pinia
  }
}
// #endif